﻿namespace WebApiSampleTemplate.Extensions.Configs
{
    public static class MiddlewareConfigure
    {
        public static void Init(this WebApplication app)
        {
            // var iotdaService = app.Services.GetRequiredService<IIoTDABridgeService>();
            // if (iotdaService != null)
            // {
            //     iotdaService.InitIoTDAClient();
            //     iotdaService.InitIoTDABridge();
            // }
        }

        public static void ConfigureMiddleware(this WebApplication app)
        {
            // Configure the HTTP request pipeline.

            if (app.Environment.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseAuthorization();

            app.MapControllers();
        }
    }
}
